<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>ShoppingShow</title>

    <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- Le styles -->
   <link href="<?php echo base_url();?>common/bootstrap.css" rel="stylesheet">
   <script type="text/javascript" src="<?php echo base_url();?>common/jquery-1.3.min.js" ></script>
   <script type="text/javascript" src="<?php echo base_url();?>common/ajax_check.js" ></script>
	<style type="text/css">
	      body {
	        padding-top: 60px;
	      }
	     
	     html, body {
        background-color: #FFFAF0;
     	 }
      	body {
        	padding-top: 50px; /* 40px to make the container go all the way to the bottom of the topbar */
     	 }
      	.container > footer p {
        text-align: center; /* center align it with the container */
     	 }
      	.container {
         width: 1100px; /* downsize our container to make the content feel a bit tighter and more cohesive. NOTE: this removes two full columns from the grid, meaning you only go to 14 columns and not 16. */
     	 }
     	 .article{
     	 	border-width:1px;
     	 	border:#FFE4E1;
     	 	
     	 	padding-top:3px; 
			padding-bottom:5%;
     	 	
     	 }
     	 .article a img.thumbnail{
			max-width:300px;
			max-height:500px;
	
			}

			.article p{
				text-align:right;
			}
			
			.img{
				text-align:center;
			}
	</style>
	</head>
<script type="text/javascript">

function checkInput(){

	var url = document.getElementById("description").value;

	if(LTrim(url).length == 0)
	{

		alert("Description can not be empty!");
		
		$("#description").focus();
		return false;
	}
	return true;
}

function LTrim(str){
	var whitespace = new String(" \t\n\r");
	var s = new String(str); 
	if (whitespace.indexOf(s.charAt(0)) != -1){
		var j=0, i = s.length;
		while (j < i && whitespace.indexOf(s.charAt(j)) != -1){
	j++;
	}
	s = s.substring(j,i);
}
return s;
}
</script>
<body>
<div class="topbar">
      <div class="fill">
        <div class="container" >
          <a class="brand" href="<?php echo base_url();?>">ShoppingShow</a>
          <ul class="nav">
          		<?php if(isset($user_id)){?>
	          		<li><a href="#"><?php echo $user_id.", welcome!";?></a></li>
	             	<li><a href="<?php echo site_url("items/mainShow");?>">MainPage</a></li>
	             	<li><a href="<?php echo site_url("users/logout");?>">Logout</a></li>
             	<?php }?>
          </ul>
        </div>
    </div>
</div>

<div class="container">
<form action="<?php echo site_url("items/items_insert")?>" method="post" onsubmit="return checkInput();">
	<?php 	
		 echo form_hidden('affiliate_url',$affiliateUrl);
		 echo form_hidden('item_price',$itemPrice);
		 echo form_hidden('creat_time',date('Y-m-d H:i:s'));
		 echo form_hidden('item_code',$itemCode);
		 echo form_hidden('genre_id',$genreId);
		 
		 $url_string=$mediumImageUrl;
		 $find="?_ex";
		 $tmp = stripos($url_string, $find);
		 $img_url=substr($url_string,0,$tmp);
		 echo form_hidden('img_url',$img_url);?>
	
		 <img SRC="<?php echo $mediumImageUrl ?>" alt="">
		 <p><textarea id="description" name="description" row='3'></textarea></p>
		 <button class="btn" type="submit">Submit</button>
</form>
</div>

</body>

</html>